﻿@using Model;
@{
    Layout = "~/Admin/_AdminSiteLayout.cshtml";
    Page.Title = "view Question Type";

    List<QuestionType> allQType = SiteHelper.GetQTypeList();

    var grid = new WebGrid(source: allQType, defaultSort: "QType", rowsPerPage: WebSite.RowsPerPage);
    if (UrlData[0] != "")
    {
        bool isDeleted = UrlData[0].AsBool();
        //bool isDeleted = Request.Form["status"].AsBool();

        if (isDeleted)
        {<p class="message success">
            Question Type deleted Successfully
        </p>
        }
        else
        {<p class="message error">
            Cannot delete requested Question Type
        </p>
        }
    }
}
<fieldset>
    <legend>Question Type List</legend>
    <div id="grid">
        @grid.GetHtml(
                tableStyle: "gridTable",
                headerStyle: "gridTableHeader",
                rowStyle: "rowstyle",
                alternatingRowStyle: "alternaterowstyle",
                columns: grid.Columns(
                grid.Column("QTId", "Id", style: "text-align-center"),
                grid.Column("QType", "Question Type", format: @<text>@item.QType</text>),
                grid.Column("CreateDate", "Create Date", style: "text-align-center"),
                grid.Column("Edit", "", format: @<a href="EditQType/@item.QTId">
                    <img src="../Images/ico-edit.png" alt="Edit" alt="Edit" /></a>, style: "text-align-center"),
                grid.Column("Delete", "", format: @<a href="DeleteQType/@item.QTId">
                    <img src="../Images/ico-delete.png" alt="Delete" alt="Delete" /></a>, style: "text-align-center")
        )
        )
    </div>
</fieldset>